# coding=utf-8
# 全世界最帅的帅哥
from ysgg1_club_comment.modules import db
from ysgg1_club_comment.modules.base_model import BaseModel
from sqlalchemy.dialects.mysql import TINYINT


class AuthPermission(BaseModel):
    __tablename__ = 'auth_permission'

    name = db.Column(db.String(64), comment="权限名字")
    parent_id = db.Column(db.BIGINT, comment="父id")
    type = db.Column(TINYINT, comment="权限类型")
    menu_url = db.Column(db.String(255), comment="菜单url")
    status = db.Column(TINYINT, comment="状态 0启用 1禁用", default=0)
    show = db.Column(TINYINT, comment="展示状态 0展示 1隐藏", default=0)
    icon = db.Column(db.String(128), comment="图标")
    permission_key = db.Column(db.String(64), comment="权限唯一标识")

    def __repr__(self):
        return f"<AuthPermission {self.name}>"
